import { createAxios } from '@/utils/http/axios';

enum Api {
  listImage = '/tbuser/deviceDataQuery/getDeviceImageData',
  initImage = '/tbuser/iotDeviceImage/initDeviceImage',
  setImageValue = '/tbuser/iotDeviceImage/setDeviceImageValue',
  delImageValue = '/tbuser/iotDeviceImage/deleteDeviceImageValue',
}

export function delImageValueApi(data: { sn: string; key: string }) {
  return createAxios({
    requestOptions: {
      apiUrl: '/hc-api',
    },
  }).post({
    url: Api.delImageValue,
    data: data,
  });
}

export function setImageValueApi(data: { sn: string; key: string; value: string }) {
  return createAxios({
    requestOptions: {
      apiUrl: '/hc-api',
    },
  }).post({
    url: Api.setImageValue,
    data: data,
  });
}

export function initDeviceImageApi(sn: String) {
  return createAxios({
    requestOptions: {
      apiUrl: '/hc-api',
    },
  }).post({
    url: Api.initImage,
    data: {
      sn: sn,
    },
  });
}

export function listDeviceImageApi(sn: String) {
  return createAxios({
    requestOptions: {
      apiUrl: '/hc-api',
    },
  }).post({
    url: Api.listImage,
    data: {
      sn: sn,
    },
  });
}
